﻿package h.ku.eval{	import h.ku.eval.FatalExceptionHandler;	import h.ku.lang.hkuObject;	import h.ku.utils.ParseUtil;		public class AssignmentEval extends FunctionEval	{		public function AssignmentEval(a:Array)		{			super("",a)		}				protected override function beginFuncEval():void		{			try{			var ref:Reference = evaluatedArgs[1]			var obj:* = ParseUtil.toNative(evaluatedArgs[0])			if(ref.property == "$")			{				FatalExceptionHandler.handleException("Illegal override")				return			}			}catch(e:Error){				FatalExceptionHandler.handleException("Illegal assignment error -- "+ref+" not a reference <0>")				return			}			try			{				//trace(ref.object.name,obj.name)				ref.object.setProperty(ref.property,obj)			}catch(e:Error)			{				try{					ref.object[ref.property] = obj				}catch(e:Error){					FatalExceptionHandler.handleException("Illegal assignment error -- not a reference <1>")					return				}							}			this.finishFunctionEval(obj)		}	}}